﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace ZEFIT
{
    public class Controller
    {
        Adabter adabter;

        public Controller(Adabter adapter)
        {
            this.adabter = adapter;
        }

        public List<object> Select()
        {
            return adabter.Select();
        }

        public void Save(Data data)
        {
            if (data.Id == 0)
            {
                adabter.Insert(ref data);
            }
            else
            {
                adabter.Update(data);
            }
        }

        public void Delete(Data data)
        {
            adabter.Delete(data.Id);
        }
    }
}
